//
//  KZHomeCollectHeader.swift
//  BoyeStore
//
//  Created by 朱凯 on 2018/6/23.
//  Copyright © 2018年 itboye. All rights reserved.
//

import UIKit

class KZHomeCollectHeader: UICollectionReusableView {
    
    var banner: KZRingBanner! = nil
    
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        banner = KZRingBanner(frame: CGRect(x: 0, y: 0, width: width, height: kScreenWidth / 2))
        self.addSubview(banner)
        
        
        let borderView = UIImageView()
        borderView.image = #imageLiteral(resourceName: "首页-推荐底图")
        self.addSubview(borderView)
        borderView.snp.makeConstraints { (m) in
            m.top.equalTo(banner.snp.bottom).offset(15)
            m.centerX.equalTo(self)
            m.height.equalTo(20)
            m.width.equalTo(borderView.snp.height).multipliedBy(208.0/20)
        }
        
        let commondLabel = UILabel()
        commondLabel.textColor = kThemeColor
        commondLabel.textAlignment = .center
        commondLabel.text = "推荐好货"
        commondLabel.font = UIFont.systemFont(ofSize: 15)
        self.addSubview(commondLabel)
        commondLabel.snp.makeConstraints { (m) in
            m.edges.equalTo(borderView)
        }
        
        
        
//        banner.items = [KZRingBannerItem(),
//                        KZRingBannerItem(),
//                        KZRingBannerItem(),]
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
}
